<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<div class="block">
    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        
        <h2>Land Cost Histories</h2>
        
    </div>
    <!-- .block_head ends -->

    
    <div class="block_content clearfix">
        <logic:notEmpty name="errorMessages" >
            <div class="message errormsg">
                <logic:iterate id="message" name="errorMessages">
                    <p><bean:write name="message"/></p>
                </logic:iterate>
            </div>
        </logic:notEmpty>
        <logic:notEmpty name="successMessages" >
            <div class="message success">
                <logic:iterate id="message" name="successMessages">
                    <p><bean:write name="message"/></p>
                </logic:iterate>
            </div>
        </logic:notEmpty>
        <fieldset id="filters">
            <legend>Filters</legend>
            <html:form action="admin/costHistoryListing.do" method="get">
                <ul>
                    <li class="search_item">
                        <label>Location Name</label>
                        <html:text property="name" styleClass="text largest"/>
                    </li>
                    <li class="search_item">
                        <html:submit styleClass="submit small" value="Filter"/>
                        <html:link action="/admin/costHistoryListing.do" styleClass="submit small gray">Refresh</html:link>
                    </li>
                </ul>
            </html:form>
        </fieldset>
            <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
                
                <thead>
                    <tr>
                        <th>Location Name</th>
                        <th width="320">Present Land Cost ( U.S. dollars / sq. foot ) </th>
                        <td width="175">&nbsp;</td>
                    </tr>
                </thead>
                
                <tbody>
                    <logic:empty name="locationList">
                        <tr>
                            <td class="align-center" colspan="7">There are no locations</td>
                        </tr>
                    </logic:empty>
                    <logic:notEmpty name="locationList">
                        <logic:iterate id="location" name="locationList">
                            <tr>
                                <td>     
                                    <html:link action="/admin/costHistory.do?action=edit" paramId="locationID" paramName="location" paramProperty="locationID">
                                        <bean:write name="location" property="locationName"/>
                                    </html:link>
                                </td>
                                <td>
                                    <fmt:formatNumber type="CURRENCY" value="${location.presentCost}"/>
                                </td>
                                <td class="delete">
                                    <html:link action="/admin/costHistory.do" paramId="locationID" paramName="location" paramProperty="locationID">
                                        Land Cost History
                                    </html:link>
                                </td>
                            </tr>
                        </logic:iterate>
                    </logic:notEmpty>
                </tbody>
                
            </table>

            <logic:notEmpty name="pagination">
                <div class="pagination right">
                    ${pagination}
                </div>
                <!-- .pagination ends -->
            </logic:notEmpty>

    </div>
    <!-- .block_content ends -->
    
    <div class="bendl"></div>
    <div class="bendr"></div>
</div>
<!-- .block ends -->